package mrms.api.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "room", schema = "mrms", catalog = "")
public class RoomEntity {
    private String id;
    private Integer size;
    private Integer opentime;
    private String device;
    private Integer permission;
    private Integer airconditioner;
    private Integer media;
    private Integer floor;
    private Integer type;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "size")
    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    @Basic
    @Column(name = "opentime")
    public Integer getOpentime() {
        return opentime;
    }

    public void setOpentime(Integer opentime) {
        this.opentime = opentime;
    }

    @Basic
    @Column(name = "device")
    public String getDevice() {
        return device;
    }

    public void setDevice(String device) {
        this.device = device;
    }

    @Basic
    @Column(name = "permission")
    public Integer getPermission() {
        return permission;
    }

    public void setPermission(Integer permission) {
        this.permission = permission;
    }

    @Basic
    @Column(name = "airconditioner")
    public Integer getAirconditioner() {
        return airconditioner;
    }

    public void setAirconditioner(Integer airconditioner) {
        this.airconditioner = airconditioner;
    }

    @Basic
    @Column(name = "media")
    public Integer getMedia() {
        return media;
    }

    public void setMedia(Integer media) {
        this.media = media;
    }

    @Basic
    @Column(name = "floor")
    public Integer getFloor() {
        return floor;
    }

    public void setFloor(Integer floor) {
        this.floor = floor;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RoomEntity that = (RoomEntity) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(size, that.size) &&
                Objects.equals(opentime, that.opentime) &&
                Objects.equals(device, that.device) &&
                Objects.equals(permission, that.permission) &&
                Objects.equals(airconditioner, that.airconditioner) &&
                Objects.equals(media, that.media) &&
                Objects.equals(floor, that.floor);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, size, opentime, device, permission, airconditioner, media, floor);
    }

    @Basic
    @Column(name = "type")
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
